<template>
  <div class="block">
    <el-carousel height="500px" :autoplay="true" arrow="never" indicator-position="none" ref="carousel"> 
      <el-carousel-item v-for="(item) in piclist" :key="item" >
        <img :src="item"/>
      </el-carousel-item>
    </el-carousel>
    <div class="mask">
        <div class="maskitem" v-for="(item,index) in piclist" :key="item">
            <img :src="item" width="100px" height="75px" @click="changepic(index)">
        </div>
    </div>
  </div>

</template>
<script>
export default{
    name:"piclist",
    data() {
        return {
            piclist:[require("@/assets/piclist1.png"),require("@/assets/piclist2.png"),require("@/assets/piclist3.png"),require("@/assets/piclist4.png")]
        };
    },
    methods: {
        changepic(num){
            this.$refs.carousel.setActiveItem(num)
        }
    },
}
</script>

<style scoped>

.el-carousel__item h3 {
    color: #475669;
    font-size: 14px;
    opacity: 0.75;
    line-height: 810px;
    margin: 0;
  }

  .el-carousel__item:nth-child(2n) {
     background-color: #99a9bf;
  }
  
  .el-carousel__item:nth-child(2n+1) {
     background-color: #d3dce6;
  }
  .mask{
    position:absolute;
    /* background-color: red; */
    width:500px;
    height:100px;
    left:50%;
    margin-top:-50px;
    transform: translate(-50%, -50%);
    z-index:2;
  }
  .maskitem{
    float: left;
    padding:10px;
  }
  .maskitem:hover{
    background:#fff;
    box-shadow:4px 4px 15px #666
  }
</style>
